let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n158,
                    i =
                    (this && this.__extends) ||
                    ((_n158 = function n(t, e) {
                            return (_n158 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n158(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        });
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.SoundSwitchCom = void 0);
                var r = t('UIComponent'),
                    a = t('SoundMrg'),
                    s = t('UIEvent'),
                    c = (function(t) {
                        function e() {
                            return (null !== t && t.apply(this, arguments)) || this;
                        }
                        return (
                            i(e, t),
                            (e.prototype.onInit = function() {
                                t.prototype.onInit.call(this);
                                var e = this.view.getChildByName('btnSwitch');
                                e.on(
                                        cc.Node.EventType.TOUCH_END,
                                        this.onTouchSwitchHandler,
                                        this
                                    ),
                                    (this._checked = !0),
                                    (this._ndNO = e.getChildByName('no')),
                                    (this._ndOFF = e.getChildByName('off')),
                                    (this._ndIcon = e.getChildByName('imgIcon')),
                                    this.refresh(!1);
                            }),
                            (e.prototype.onTouchSwitchHandler = function() {
                                this.checked ?
                                    (a.SoundMrg.click(), this.delayCall(0.1, this.change)) :
                                    (this.change(), a.SoundMrg.click());
                            }),
                            (e.prototype.change = function() {
                                this.checked = !this.checked;
                            }),
                            Object.defineProperty(e.prototype, 'checked', {
                                get: function get() {
                                    return this._checked;
                                },
                                set: function set(t) {
                                    this._checked != t &&
                                        ((this._checked = t),
                                            this.refresh(!0),
                                            this.emit(s.UIEvent.Changed, t));
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (e.prototype.refresh = function(t) {
                                t
                                    ?
                                    this.checked ?
                                    (cc
                                        .tween(this._ndIcon)
                                        .to(0.1, {
                                            x: 53
                                        })
                                        .start(),
                                        cc
                                        .tween(this._ndNO)
                                        .to(0.1, {
                                            opacity: 255
                                        })
                                        .start(),
                                        cc
                                        .tween(this._ndOFF)
                                        .to(0.1, {
                                            opacity: 0
                                        })
                                        .start()) :
                                    (cc
                                        .tween(this._ndIcon)
                                        .to(0.1, {
                                            x: -53
                                        })
                                        .start(),
                                        cc
                                        .tween(this._ndNO)
                                        .to(0.1, {
                                            opacity: 0
                                        })
                                        .start(),
                                        cc
                                        .tween(this._ndOFF)
                                        .to(0.1, {
                                            opacity: 255
                                        })
                                        .start()) :
                                    this.checked ?
                                    ((this._ndIcon.x = 53),
                                        (this._ndNO.opacity = 255),
                                        (this._ndOFF.opacity = 0)) :
                                    ((this._ndIcon.x = -53),
                                        (this._ndNO.opacity = 0),
                                        (this._ndOFF.opacity = 255)),
                                    this.setGray(!this.checked);
                            }),
                            e
                        );
                    })(r.UIComponent);
                (o.SoundSwitchCom = c), console.log("end");
            module.exports =  e.exports;